#include "Code.h"
#include <iostream>

CCode::CCode( std::istream& is )
    : m_stream(is) , m_nCharNumber(0), m_nLineNumber(0)
{
    
}

CCode::~CCode()
{

}

bool CCode::GetChar(char& ch)
{
    m_stream.get(ch);
	if (ch == '\n')
	{
		++m_nLineNumber;
		m_nCharNumber = 0;
	}
	else
	{
		++m_nCharNumber;
	}
    return m_stream;
}

bool CCode::PeekChar( char& ch )
{
	ch = m_stream.peek();
    return m_stream;
}